<template>
	<!-- 木工组 -->
	<view class="upload">
		<uniTabs :tabs="tabs" :activeTab="activeTab" lineHeight="false" @change="change" activeColor="#DD524D" class="tabs"></uniTabs>
	<!-- 	<view class="" v-show="activeTab===0">
			<view class="top">
				<text class="nav">班组信息</text>
				<view class="">
					<text>班组名称：</text>
					<text>张三木工班组</text>
				</view>
				<view class="">
					<text>隶属劳务公司：</text>
					<text>苏州相城型劳务公司</text>
				</view>
				<view class="">
					<text>班组负责人：</text>
					<text>孙大大</text>
				</view>
				<view class="">
					<text>成立日期：</text>
					<text>2020-08-01</text>
				</view>
				<view class="">
					<text>办公地址：</text>
					<text>苏州市相城区元和街道</text>
				</view>
			</view>
			<view class="bottom">
				<text class="nav">我的信息</text>
				<view class="">
					<text>工人姓名：</text>
					<text>路人甲</text>
				</view>
				<view class="">
					<text>工种类型：</text>
					<text>普工</text>
				</view>
				<view class="">
					<text>工种：</text>
					<text>木工</text>
				</view>
				<view class="">
					<text>加入时间：</text>
					<text>2018-12-25</text>
				</view>
				<view class="">
					<text>离开时间：</text>
					<text></text>
				</view>
			</view>
		</view> -->

		<view class="" v-show="activeTab===0">
			<view class="footer" v-for="(item,index) in teamList">
				<view class="">
					班组名称：{{item.name}}
				</view>
				<view class="">
					班组长：{{item.user_id_name}}
				</view>
				<view class="foot_ter">
					<text>联系方式：{{item.team_leader_phone}}</text><text class="text">{{item.work_type_name}}</text>
				</view>
			</view>
			<image v-if="teamList.length<1" style="margin: 60rpx 56rpx;" src="../../../static/image/no-data.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import uniTabs from '@/components/v-tabs/v-tabs.vue'
	import api from '@/static/js/api.js'
	export default {
		components: {
			uniTabs
		},

		data() {
			return {
				tabs: [
					// '当前班组',
					'我的班组',
				],
				activeTab: 0,
				userinfo:'',
				teamList:[]
			}
		},
       onShow() {
       	 this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
       	 this.classList()
       },
		methods: {
			change(index) {
				this.activeTab = index
			},
			classList(){
			  // this.userinfo.company_id = 892
				api.laborClass('jhj.company','_api_public_one_company',this.userinfo.location_company_id).then(res=>{
							  this.teamList = res.data[0].team_list
				 }).catch(e => {
					uni.showToast({
						icon: 'none',
						title: e.message
					})
				})
			}
			
		}

	}
</script>

<style lang="less" scoped>
	.upload {
		width: 100%;
		height: 100vh;
		background-color: #EBEEF5;
	}

	.tabs {
		position: relative;
	}

	/deep/ .v-tabs {
		width: 100%;
		height: 100rpx;
		background-color: #FFFFFF;
		line-height: 100rpx;
	}

	/deep/ .v-tabs__container-item {
		width: 100%;
		justify-content: center;
	}

	.top {
		font-size: 28rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;

		.nav {
			display: block;
			padding: 30rpx;
			color: #DD524D;
			font-size: 30rpx;
			font-weight: 600;
		}

		view {
			padding: 15rpx 40rpx;
			display: flex;
			justify-content: space-between;
		}
	}

	.bottom {
		font-size: 28rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;

		.nav {
			display: block;
			padding: 30rpx;
			color: #DD524D;
			font-size: 30rpx;
			font-weight: 600;
		}

		view {
			padding: 15rpx 40rpx;
			display: flex;
			justify-content: space-between;
		}
	}

	.footer {
		font-size: 28rpx;
		background-color: #FFFFFF;
		margin-top: 20rpx;

		view {
			padding: 15rpx 40rpx;
		}

		.foot_ter {
			display: flex;
			justify-content: space-between;

			.text {
				padding: 4rpx 10rpx;
				background-color: #007AFF;
				color: #FFFFFF;
				border-radius: 10rpx;
			}
		}

	}
</style>
